define(['./deps', './resolver'],function (deps, resolver) {
  return angular.module('app.controller', [])
  .config(
    [
        '$routeProvider',
        '$locationProvider',
        '$controllerProvider',
        '$compileProvider',
        '$filterProvider',
        '$provide',
        function($routeProvider, $locationProvider, $controllerProvider, $compileProvider, $filterProvider, $provide){
	        this.controller = $controllerProvider.register;
	        this.directive  = $compileProvider.directive;
	        this.filter     = $filterProvider.register;
	        this.factory    = $provide.factory;
	        this.service    = $provide.service;
           
          $locationProvider.html5Mode(true);
          $routeProvider
          .when('/',function(params){
            console.log('routing jalan di: ' + params.ctrl);
                return {
                  templateUrl:params.ctrl+'.html', 
                  resolve:resolver(params.ctrl)
                }
          })
          .otherwise({ 
            resolve:function(params){
              console.log(params);
            }
            ,redirectTo:'/'
          });
          
        }
    ]);
});